_loadFile(file, width, height) {
let [validResourceScale, resourceScale] = this.actor.get_resource_scale();
+ let wasPlaying = this._isPlaying;
+
+ if (this._isPlaying)
+ this.stop();
this._isLoaded = false;
this.actor.destroy_all_children();
- if (!validResourceScale)
+ if (!validResourceScale) {
+ if (wasPlaying)
+ this.play();
return;
+ }
let textureCache = St.TextureCache.get_default();
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
scaleFactor, resourceScale,
this._animationsLoaded.bind(this));
this.actor.set_child(this._animations);
+
+ if (wasPlaying)
+ this.play();
}
_showFrame(frame) {